package com.mall.sso.web.controller;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author zhaoren
 * @version 1.0
 * @description TODO
 * @date 2020/9/15 14:49
 **/

@Controller
public class PageController {

    /**
     * 跳转到登录页面或者注册页面
     * @param page
     * @param redirect
     * @return
     */
    @GetMapping("/page/{page}")
    public String registerIndex(@PathVariable("page") String page, String redirect, Model model){
        //如果需要重定向，将redirect信息放入跳转的视图中
        if(StringUtils.isNotBlank(redirect)){
            model.addAttribute("redirect",redirect);
        }
        return page;
    }

}
